unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
  public
    procedure CreateParams(var Params: TCreateParams);override;  
  end;

var
  Form2: TForm2;

function FuncViewForm2:Integer;

implementation

uses
  Unit3;

{$R *.dfm}
function FuncViewForm2:Integer;
begin
  try
    Form2:=TForm2.Create(nil);
    Result:=Form2.ShowModal;
  finally
    FreeAndNil(Form2);
  end;
end;  

procedure TForm2.Button1Click(Sender: TObject);
begin
  FuncViewForm3;
end;

procedure TForm2.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  //Params.WndParent := GetDesktopWindow;
  //OR
  //Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
  //SetWindowLong(self.Handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
end;

end.
 